<?php
namespace aliPay;

class Config{
    public function configure(){
        $res = db('Plugin') -> where('code', 'alipay') -> value('config_value');
        $res = unserialize($res);

        $config = array (
            //应用ID,您的APPID。
            'app_id' => $res['app_id'],

            //商户私钥
            'merchant_private_key' => $res['merchant_private_key'],
          
            //同步跳转
            'return_url' => url('component/pay/alinotify', [], false, true),
          
          	//异步跳转
          	'notify_url' => '',

            //编码格式
            'charset' => "UTF-8",

            //签名方式
            'sign_type'=>"RSA2",

            //支付宝网关
            'gatewayUrl' => "https://openapi.alipay.com/gateway.do",

            //支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
            'alipay_public_key' => $res['alipay_public_key'],
        );

        return $config;
    }
}

$configure = new Config();
$config = $configure -> configure();

